package com.blogSystem.article.dao;

import com.blogSystem.article.pojo.Article;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Date;
import java.util.List;


public interface ArticleDao extends MongoRepository<Article,String> {
public  Page<Article> findAll(Pageable pageable);
public Page<Article> findByAuthor(Pageable pageable,String author);
public Page<Article> findByAuthorLike(Pageable pageable,String author);
public Page<Article> findByType(Pageable pageable,String type);
public Page<Article> findByLabel(Pageable pageable,String label);
public Page<Article> findByTitle(Pageable pageable,String title);
public Page<Article> findByTitleLike(Pageable pageable,String title);
public Page<Article> findByState(Pageable pageable,Integer state);
public Page<Article> findAllByCategoryAndState(Pageable pageable,String category,Integer state);
public void deleteArticlesByUploadTimeBeforeAndState(Date uploadTime,Integer state);
public List<Article> findAllByState(Integer state,Sort sort);
public List<Article> findAllByState(Integer state);
public List<Article> findAllByStateAndType(Integer state,String type);
public List<Article> findAllByStateAndCategory(Integer state,String category);
public Page<Article> findByLabelsContains(Pageable pageable,String label);
}
